 

#region Copyright Statement
//////////////////////////////////////////////
//	ORMAC
//  By: Ali Ghomi (2011)
//////////////////////////////////////////////
#endregion

#region using
using System;
using System.Collections.Generic;
using ORMAC;
using ORMAC.Attributes;
using System.Runtime.Serialization;
#endregion

namespace Test
{
	/// <summary>
	/// Auto generated repository class by ORMAC from Test database
	/// </summary>
	public class TestRepository
	{
		#region Private Members
		private string m_ConnectionString { get; set; }
		#endregion
		
		#region Constructor
		public TestRepository(string cnn)
		{
			m_ConnectionString = cnn;
		}
		#endregion
		
		#region Stored Procedure Calls
		[StoredProcedure(Name = "Ten Most Expensive Products")]
		List<OTenMostExpensiveProductsResult> TenMostExpensiveProducts(){
			IReader ormac = new OReader();
			ormac.SetConnectionString(m_ConnectionString);
			var res = ormac.Exceute<OTenMostExpensiveProductsResult>(this, "Ten Most Expensive Products" );
			return res;
		}
        
  
		[SPParam(DBName = "@Beginning_Date")]  
		[SPParam(DBName = "@Ending_Date")]		[StoredProcedure(Name = "Employee Sales by Country")]
		List<OEmployeeSalesbyCountryResult> EmployeeSalesbyCountry(DateTime Beginning_Date ,DateTime Ending_Date){
			IReader ormac = new OReader();
			ormac.SetConnectionString(m_ConnectionString);
			var res = ormac.Exceute<OEmployeeSalesbyCountryResult>(this, "Employee Sales by Country" ,Beginning_Date,Ending_Date);
			return res;
		}
        
  
		[SPParam(DBName = "@Beginning_Date")]  
		[SPParam(DBName = "@Ending_Date")]		[StoredProcedure(Name = "Sales by Year")]
		List<OSalesbyYearResult> SalesbyYear(DateTime Beginning_Date ,DateTime Ending_Date){
			IReader ormac = new OReader();
			ormac.SetConnectionString(m_ConnectionString);
			var res = ormac.Exceute<OSalesbyYearResult>(this, "Sales by Year" ,Beginning_Date,Ending_Date);
			return res;
		}
        
  
		[SPParam(DBName = "@OrderID")]		[StoredProcedure(Name = "CustOrdersDetail")]
		List<OCustOrdersDetailResult> CustOrdersDetail(int OrderID){
			IReader ormac = new OReader();
			ormac.SetConnectionString(m_ConnectionString);
			var res = ormac.Exceute<OCustOrdersDetailResult>(this, "CustOrdersDetail" ,OrderID);
			return res;
		}
        
  
		[SPParam(DBName = "@CustomerID")]		[StoredProcedure(Name = "CustOrdersOrders")]
		List<OCustOrdersOrdersResult> CustOrdersOrders(string CustomerID){
			IReader ormac = new OReader();
			ormac.SetConnectionString(m_ConnectionString);
			var res = ormac.Exceute<OCustOrdersOrdersResult>(this, "CustOrdersOrders" ,CustomerID);
			return res;
		}
        
  
		[SPParam(DBName = "@CustomerID")]		[StoredProcedure(Name = "CustOrderHist")]
		List<OCustOrderHistResult> CustOrderHist(string CustomerID){
			IReader ormac = new OReader();
			ormac.SetConnectionString(m_ConnectionString);
			var res = ormac.Exceute<OCustOrderHistResult>(this, "CustOrderHist" ,CustomerID);
			return res;
		}
        
  
		[SPParam(DBName = "@CategoryName")]  
		[SPParam(DBName = "@OrdYear")]		[StoredProcedure(Name = "SalesByCategory")]
		List<OSalesByCategoryResult> SalesByCategory(string CategoryName ,string OrdYear){
			IReader ormac = new OReader();
			ormac.SetConnectionString(m_ConnectionString);
			var res = ormac.Exceute<OSalesByCategoryResult>(this, "SalesByCategory" ,CategoryName,OrdYear);
			return res;
		}
        
		#endregion
	}
}
